package model

import java.awt.Color
import org.uqbar.arena.layout.HorizontalLayout
import org.uqbar.arena.layout.VerticalLayout
import org.uqbar.arena.widgets.Button
import org.uqbar.arena.widgets.Panel
import org.uqbar.arena.windows.WindowOwner
import templates.AgregarNuevo
import templates.MyOwnSimpleWindow

class EditarVillanoView extends MyOwnSimpleWindow<Villano>{
	
		
	@Property val AgregarNuevo template = new AgregarNuevo
	
	new(WindowOwner owner, Villano villano) {
		super(owner, villano )
	}
	
	override createContents(Panel mainPanel) {
		setTitle("Expedientes - Editar Villano")
		mainPanel.setLayout(new VerticalLayout())
		
		val panel1 = new Panel(mainPanel).setLayout(new HorizontalLayout())
		this.template.labelAndBox(panel1, "Nombre: ", "nombre")
		
		this.template.labelAndSelector(panel1, "Sexo: " , "sexosPosibles" , "sexo")
		
		this.template.caracteristicaBundle(mainPanel, "Señas Particulares ",
										 "senhas",[| new EditarSenhasParticularesView(this , this.modelObject).open])
		
		this.template.caracteristicaBundle(mainPanel, "Hobbies ",
					"hobbies",[| new EditarHobbiesView(this, this.modelObject).open])	
		
		
		new Button(mainPanel) => [
				setCaption("Aceptar")
				setBackground(Color :: LIGHT_GRAY)
				onClick( [| close])
			]
		}
}